﻿using System.ServiceModel.Channels;
using CID.Domain.Infrastructure;
using CID.Execution.Controller.Support;
using NUnit.Framework;

namespace CID.Execution.Controller.Tests.Support
{
    [TestFixture]
    class AgentServiceProxyFactoryTests : BaseControllerTests
    {
        private IDeploymentAgent deploymentAgent;

        public override void SetUp()
        {
            base.SetUp();
            deploymentAgent = InfrastructureData.DeploymentAgent;
        }

        [Test]
        public void TestCreate_ShouldReturnProxy()
        {
            var result = AgentServiceProxyFactory.Instance.Create(deploymentAgent);

            Assert.IsNotNull(result);
            Assert.IsInstanceOf<IChannel>(result);
        }

        [Test]
        public void TestDispose_ShouldSucceed()
        {
            var result = AgentServiceProxyFactory.Instance.Create(deploymentAgent);

            AgentServiceProxyFactory.Instance.Dispose(result);
        }
    }
}
